package papacharly.encheres.model;
// Generated 12 mars 2011 11:05:58 by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Produit generated by hbm2java
 */
@Entity
@Table(name="produit"
    ,catalog="PAPACHARLY"
)
public class Produit  implements java.io.Serializable {


     private Integer idProduit;
     private User user;
     private Categorie categorie;
     private String libelle;
     private String description;
     private float prixDepart;
     private float prixImmediat;
     private Date dateDebut;
     private Date dateFin;
     private Set<Enchere> encheres = new HashSet<Enchere>(0);

    public Produit() {
    }

	
    public Produit(User user, Categorie categorie, String libelle, String description, float prixDepart, float prixImmediat, Date dateDebut, Date dateFin) {
        this.user = user;
        this.categorie = categorie;
        this.libelle = libelle;
        this.description = description;
        this.prixDepart = prixDepart;
        this.prixImmediat = prixImmediat;
        this.dateDebut = dateDebut;
        this.dateFin = dateFin;
    }
    public Produit(User user, Categorie categorie, String libelle, String description, float prixDepart, float prixImmediat, Date dateDebut, Date dateFin, Set<Enchere> encheres) {
       this.user = user;
       this.categorie = categorie;
       this.libelle = libelle;
       this.description = description;
       this.prixDepart = prixDepart;
       this.prixImmediat = prixImmediat;
       this.dateDebut = dateDebut;
       this.dateFin = dateFin;
       this.encheres = encheres;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idProduit", unique=true, nullable=false)
    public Integer getIdProduit() {
        return this.idProduit;
    }
    
    public void setIdProduit(Integer idProduit) {
        this.idProduit = idProduit;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idVendeur", nullable=false)
    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idCategorie", nullable=false)
    public Categorie getCategorie() {
        return this.categorie;
    }
    
    public void setCategorie(Categorie categorie) {
        this.categorie = categorie;
    }
    
    @Column(name="libelle", nullable=false, length=50)
    public String getLibelle() {
        return this.libelle;
    }
    
    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }
    
    @Column(name="description", nullable=false, length=65535)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    @Column(name="prixDepart", nullable=false, precision=12, scale=0)
    public float getPrixDepart() {
        return this.prixDepart;
    }
    
    public void setPrixDepart(float prixDepart) {
        this.prixDepart = prixDepart;
    }
    
    @Column(name="prixImmediat", nullable=false, precision=12, scale=0)
    public float getPrixImmediat() {
        return this.prixImmediat;
    }
    
    public void setPrixImmediat(float prixImmediat) {
        this.prixImmediat = prixImmediat;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="dateDebut", nullable=false, length=19)
    public Date getDateDebut() {
        return this.dateDebut;
    }
    
    public void setDateDebut(Date dateDebut) {
        this.dateDebut = dateDebut;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="dateFin", nullable=false, length=19)
    public Date getDateFin() {
        return this.dateFin;
    }
    
    public void setDateFin(Date dateFin) {
        this.dateFin = dateFin;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="produit")
    public Set<Enchere> getEncheres() {
        return this.encheres;
    }
    
    public void setEncheres(Set<Enchere> encheres) {
        this.encheres = encheres;
    }




}


